package com.tanhua.dubbo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tanhua.domain.SoulTest.UserSoulResult;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface ResultMapper extends BaseMapper<UserSoulResult> {
    @Update("UPDATE `tb_user_soul_result` SET cid=#{scoreType} WHERE user_id=#{userId}")
    void updateUserSoulResult(@Param("userId") Long userId,@Param("scoreType") String scoreType);

    @Select("SELECT ${facility} FROM tb_user_soul_result WHERE user_id=#{userId}")
    Integer getLocked(@Param("facility") String facility,@Param("userId") Long userId);

    @Update("UPDATE`tb_user_soul_result` SET ${facility}=0 WHERE user_id=#{userId}")
    void openLocked(@Param("facility") String facility, @Param("userId") Long userId);
}
